package com.zust.zst.teacher.service.impl;

import com.zust.zst.common.dto.teacher.AddTeacherDTO;
import com.zust.zst.common.dto.teacher.Teacher;
import com.zust.zst.common.vo.teacher.UpdateVO;
import com.zust.zst.dao.mapper.teacher.TeacherMapper;
import com.zust.zst.teacher.service.TeacherCourseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("TeacherCourseServiceImpl")
public class TeacherCourseServiceImpl implements TeacherCourseService {
    @Resource
    private TeacherMapper teacherMapper;


    @Override
    public List<Teacher> showAllTeachers(int startIndex, int pageSize) {
        return teacherMapper.showAllTeachers(startIndex,pageSize);
    }

    @Override
    public List<Teacher> getTeacherById(int uid) {
        return teacherMapper.getTeacherById(uid);
    }

    @Override
    public List<Teacher> getTeacherByName(String name) {
        return teacherMapper.getTeacherByName(name);
    }

    @Override
    public int addTeacher(AddTeacherDTO addTeacherDTO) {
        return teacherMapper.addTeacher(addTeacherDTO);

    }

    @Override
    public int updateTeacher(UpdateVO updateVO) {
       return teacherMapper.updateTeacher(updateVO);
    }

    @Override
    public int deleteTeacher(int uid) {
        return teacherMapper.deleteTeacher(uid);
    }

    @Override
    public int getTotalTeacher() {
        return teacherMapper.getTotalTeacher();
    }
}
